//
//  InterNationDetailController.m
//  PASystem
//
//  Created by 刘沿 on 16/8/16.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "InterNationDetailController.h"
#import "InterNationDetailModel.h"
#import "DetailCellModel.h"
#import "FSDetailTableViewCell.h"
#import "MembershipType.h"
#import "DepartmentView.h"
#import "InstructionsView.h"

@interface InterNationDetailController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,strong) NSMutableArray *dataArray;
@property (nonatomic,strong) NSMutableArray *dataArray2;

@property (nonatomic,strong) UITableView *tabV;
@property (nonatomic,strong) UITableView *tab2;

@property (nonatomic,strong) UIScrollView *btnV;
@property (nonatomic,strong) UIView *view3;

@end

@implementation InterNationDetailController

-(NSMutableArray *)dataArray{
    if (_dataArray == nil) {
        
        _dataArray = [NSMutableArray array];
    }

    return _dataArray;
}

- (NSMutableArray *)dataArray2{
    if (_dataArray2 == nil) {
        
        _dataArray2 = [NSMutableArray array];
    }

    return _dataArray2;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"企业详情";
    self.view.backgroundColor = [UIColor whiteColor];
    CGFloat H = self.view.height *2 / 5;
    
    UITableView *tabV = [[UITableView alloc] init];
    
    tabV.backgroundColor = [UIColor whiteColor];
    
    self.tabV = tabV;
    
    tabV.dataSource = self;
   
    tabV.delegate = self;
    
    [self.view addSubview:tabV];
    
    [tabV mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.view.mas_top);
        
        make.left.equalTo(self.view.mas_left);
        
        make.right.equalTo(self.view.mas_right);
        
        make.height.equalTo(@(H));
    }];
    
    [self loadData];

}

- (void)loadData{
    
    NSString * userId = [[NSUserDefaults standardUserDefaults]objectForKey:@"userId"];
    NSString * pwdId = [[NSUserDefaults standardUserDefaults]objectForKey:@"pwdId"];
    NSString * userHumber = [[NSUserDefaults standardUserDefaults]objectForKey:@"userHumber"];
    
    NSString *json = [NSString stringWithFormat:@"{'action': gjshMch,'service': MemberService, 'userName':'%@','password':'%@', 'vaueJson':'{userid :%@,id:%@ }'}",userId,pwdId,userHumber,self.ID];
    
    NSArray * array = @[@{@"arg0":json}];
    
    [HttpTools requestWithURL:BaseURL arrays:array method:Basemethod success:^(id JSON) {
      
        NSDictionary *dict = JSON[@"reason"];
        NSDictionary *dict2 = dict[@"attrs"];
        InterNationDetailModel *model = [InterNationDetailModel mj_objectWithKeyValues:dict2];
        
        [self.dataArray addObject:model];
        
        NSArray *arr = JSON[@"responsible"];
        
        if (arr.count) {
            for (NSDictionary *dict in arr) {
                
                NSDictionary *resDict = dict[@"attrs"];
                
                DetailCellModel *mod = [DetailCellModel mj_objectWithKeyValues:resDict];
                
                [self.dataArray2 addObject:mod];
            }

        }
  
        [self setUp:self.dataArray2];
        [self.tabV reloadData];
//        [self.tab2 reloadData];
    } failure:^(NSError *error) {
        
    }];
    
    
}

- (void)setUp:(NSMutableArray *)arr1{

    //按钮的父控件
    UIScrollView *btnView = [[UIScrollView alloc] init];
        
    self.btnV = btnView;
    
    [btnView setContentSize:CGSizeMake(self.view.frame.size.width + 50, 44)];
    
    btnView.backgroundColor = [UIColor grayColor];
    
    [self.view addSubview:btnView];
    
    [btnView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.tabV.mas_bottom);
        make.left.equalTo(self.view.mas_left);
        make.right.equalTo(self.view.mas_right);
        make.height.equalTo(@44);
    }];

    NSArray *arr = @[@"企业负责人信息",@"会员类型及会费",@"内设部门及机构",@"说明建议"];
    CGFloat ViewW = self.view.frame.size.width;
    
    CGFloat w = 0;//保存前一个button的宽以及前一个button距离屏幕边缘的距离
    CGFloat h = 0;//用来控制button距离父视图的高
    for (int i = 0; i < arr.count; i ++) {
        
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        
        [btn setTitle:arr[i] forState:UIControlStateNormal];
        [btn.titleLabel setFont:[UIFont systemFontOfSize:12]];
        
        [btn addTarget:self action:@selector(BtnClick:) forControlEvents:UIControlEventTouchUpInside];
        
        btn.tag = i;
        
        //计算大小
        NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:12]};
        CGFloat length = [arr[i] boundingRectWithSize:CGSizeMake(ViewW, 100) options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil].size.width;
              
        btn.frame = CGRectMake(w +10, h, length , 44);
        //当button的位置超出屏幕边缘时换行 320 只是button所在父视图的宽度
        
        w = btn.frame.size.width + btn.frame.origin.x;
        
        [btnView addSubview:btn];
        
    }
    //存放tab
    UIView *view3 = [[UIView alloc] init];
    
    self.view3 = view3;
    
    [self.view addSubview:view3];
    
    [view3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(btnView.mas_bottom);
        make.left.equalTo(self.view.mas_left);
        make.right.equalTo(self.view.mas_right);
        make.bottom.equalTo(self.view.mas_bottom).mas_offset(-49);
    }];
    
    UITableView *tab2 = [[UITableView alloc] init];
    
    tab2.delegate = self;
    
    tab2.dataSource = self;
    
    self.tab2 = tab2;
    
    [view3 addSubview:tab2];
    
    tab2.backgroundColor = [UIColor whiteColor];
    
    [tab2 mas_makeConstraints:^(MASConstraintMaker *make) {
    
        make.top.equalTo(btnView.mas_bottom);
        make.left.equalTo(self.view.mas_left);
        make.right.equalTo(self.view.mas_right);
        make.bottom.equalTo(self.view.mas_bottom).mas_offset(-49);
    }];
    
    UILabel *lbl = [[UILabel alloc] init];
    
    lbl.hidden = YES;
    
    lbl.text = @"暂时还没有数据哦";
    
    [view3 addSubview:lbl];
    
    [lbl mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerX.equalTo(view3.mas_centerX);
        make.centerY.equalTo(view3.mas_centerY);
        make.width.equalTo(@200);
        make.height.equalTo(@44);
    }];
    
    if (arr1.count == 0) {
        
        lbl.hidden = NO;
        tab2.hidden = YES;
    }
    
}

#pragma mark----按钮点击事件
- (void)BtnClick:(UIButton *)btn{

    InterNationDetailModel *model = self.dataArray.firstObject;
    
    if (btn.tag == 0) {
//企业负责人信息
        [self.view3.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        
        [self.view3 addSubview:self.tab2];
        
        [self.tab2 mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.top.equalTo(self.btnV.mas_bottom);
            make.left.equalTo(self.view.mas_left);
            make.right.equalTo(self.view.mas_right);
            make.bottom.equalTo(self.view.mas_bottom).mas_offset(-49);
        }];
        
    }else if(btn.tag == 1){
//会员类型及会费
        [self.view3.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    
        MembershipType *memV = [MembershipType WithMembershipType];
        
        memV.model = model;
        
        [self.view3 addSubview:memV];
        
    }else if (btn.tag == 2){
//内设部门及机构
        [self.view3.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    
        DepartmentView *deV = [DepartmentView WithDepartmentView];
        
        deV.model = model;
        
        [self.view3 addSubview:deV];
        
    }else{
//说明建议
    
        InstructionsView *insV = [InstructionsView WithInstructionsView];
        
        insV.model = model;
        
        [self.view3 addSubview:insV];
        
        [insV mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.top.equalTo(self.view3.mas_top);
            make.left.equalTo(self.view3.mas_left);
            make.right.equalTo(self.view3.mas_right);
            make.bottom.equalTo(self.view3.mas_bottom);
        }];
        
        
    }

}


#pragma mark------tableView

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    if (tableView == self.tabV) {
        return 17;

    }else{
        return self.dataArray2.count;
    
    }
    
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (tableView == self.tabV) {
        
        InterNationDetailModel *model = self.dataArray.firstObject;
        
        if (indexPath.row == 0) {
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10,80, 40)];
            
            label.text = @"机构名称:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.NAME;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }else if (indexPath.row == 1){
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 80, 40)];
            
            label.text = @"批准单位:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.APPROVED;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
            
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            return cell;
            
        }
        else if (indexPath.row == 2){
            
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"批准文号及时间:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.APPROVEDCODE;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
            
        }
        else if (indexPath.row == 3){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10,200, 40)];
            
            label.text = @"是否与贸促会合署办公:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.ISCOOPERATION;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }
        else if (indexPath.row == 4){
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 120, 40)];
            
            label.text = @"首次登记时间:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.REGISTERTIME;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
        }
        else if (indexPath.row == 5){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"是否在民政登记:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.ISREGISTER;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }
        else if (indexPath.row == 6){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 80, 40)];
            
            label.text = @"法人代表:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.LEGALPERSON;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }
        else if (indexPath.row == 7){
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"秘书长是否专职:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.ISMS;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
        }
        else if (indexPath.row == 8){
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"专职工作人员数:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.WORKPNUME;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
        }
        else if (indexPath.row == 9){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"实有工作人员数:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.ACTUALPNUME;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }
        else if (indexPath.row == 10){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 80, 40)];
            
            label.text = @"内部刊物:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.PUBLICATION;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }
        else if (indexPath.row == 11){
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"发行数量(册／年):";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.PUBLICATIONNUM;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
        }
        else if (indexPath.row == 12){
            
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 60, 40)];
            
            label.text = @"填表人:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.FILLPERSON;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
        }else if (indexPath.row == 13){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 140, 40)];
            
            label.text = @"填表人手机号码:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.FILLPHON;
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }else if (indexPath.row == 14){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 100, 40)];
            
            label.text = @"填表人传真:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.FILLFOX;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }else if (indexPath.row == 15){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 100, 40)];
            
            label.text = @"填表人电话:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.FILLTEL;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }else if (indexPath.row == 16){
            UITableViewCell* cell = [[UITableViewCell alloc]init];
            
            UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 40, 40)];
            
            label.text = @"邮箱:";
            
            label.font = [UIFont systemFontOfSize:15];
            
            [cell.contentView addSubview:label];
            
            UILabel *lbl2 = [[UILabel alloc] init];
            
            lbl2.font = [UIFont systemFontOfSize:15];
            
            lbl2.text = model.FILLEMAIL;
            
            [cell.contentView addSubview:lbl2];
            
            [lbl2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.centerY.equalTo(label.mas_centerY);
                make.left.equalTo(label.mas_right);
                make.height.equalTo(label.mas_height);
                make.right.equalTo(cell.contentView.mas_right);
            }];
            
            
            return cell;
            
        }else{
            
            return nil;
            
        }

        
    }else{
    
        DetailCellModel *model = self.dataArray2[indexPath.row];
        
        NSString *ID = @"DetailTableView";
        
        FSDetailTableViewCell *cell = [FSDetailTableViewCell WithDetailTableViewCell];
        
        if (cell == nil) {
            
            cell = [[FSDetailTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        }
        
        cell.model = model;
        
        return cell;

    
    }
    
}
/*

    
*/
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (tableView == self.tabV) {
        
        return 44;
    }else{
        
        return 170;
    }
    
    
}




@end
